package by.grsu.mf;

import by.grsu.mf.R;
import by.grsu.mf.constants.AllConstants;
import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.InflateException;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class LoginActivity extends Activity {
	
	private final String clientId = AllConstants.CLIENT_ID;

	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       
        setContentView(R.layout.authorization);
        WebView mWebView = (WebView) findViewById(R.id.webAuthorization);      
        mWebView.setWebViewClient(new mWebClient());
        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.loadUrl("https://oauth.vk.com/authorize?client_id=3245218" +
        		"&scope=friends,messages&redirect_uri=http://vk.com&display=touch&response_type=token");	}

	private class mWebClient extends WebViewClient {
		
		@Override
		public void onPageStarted(WebView view, String url, Bitmap favicon) {
			// TODO Auto-generated method stub
			super.onPageStarted(view, url, favicon);
		}
		
		@Override
		public boolean shouldOverrideUrlLoading(WebView view, String url) {
			// TODO Auto-generated method stub
			view.loadUrl(url);
			return true;
		}
	

	}
	
}
